<?php
class AlbumController extends mcz_Controller
{
    public function __construct()
    {
		if(!$_SESSION['obj']->isAuth())
		{
			header('location: ' . mczURL('/auth'));
			die;
		}
		$this->setLayout('layout');
    }
	public function showAction($album)
	{
		$album = urldecode($album);
		$this->assignToLayout('title', $album);
		$tunes = mcz_Object::hydrate('mcz_Tune', mcz_DB::getInstance()
									 ->fetch('* from mcz_Tune where album like ? order by track asc',
											 array($album)));
		$this->display('album', array(
									  'tunes' => $tunes,
									  'album' => $album
									  ));
	}
}